import axios from 'axios'
import { baseURL } from '../configFile'
import { RelatedLink } from '../types/Frame'

const axiosReq = axios.create({
    baseURL
})

//获取banner
export const bannerReq = () => {
    return axiosReq.get('/queryBannerPicture')
}

//获取相关链接
export const relatedLinkReq = () => {
    return axiosReq.get('/queryRelatedLink')
}

//更改banner
export const modifyBannerPicture = (file: File) => {
    return axiosReq.post('/modifyBannerPicture', file)
}

//更改相关链接
export const modifyRelatedLinksReq = (relatedLink: RelatedLink[]) => {
    return axiosReq.post('/modifyRelatedLinks', { 'RelatedLinks': relatedLink })
}